<?php

Class CommonAction extends Action{

    public function _initialize(){
//        p($_SESSION);die;
        if(!isset($_SESSION[C('USER_AUTH_KEY')])){
            $this->redirect('Admin/Login/index');
        }

        $notAuth = in_array(MODULE_NAME,explode(',',C('NOT_AUTH_MODULE'))) ||
        in_array(ACTION_NAME,explode(',',C('NOT_AUTH_ACTION')));//T或F=>T不用读后面的,F或T->T读后面的,F或F->F
//        die;

        if(C('USER_AUTH_ON') && !$notAuth){
            import('ORG.Util.RBAC');
            RBAC::AccessDecision('Admin') || $this->error('没有权限');
        }
    }

}

?>